//
//  AXSpellDetailsFirstCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/13.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXSpellDetailsFirstCell.h"


@implementation AXSpellDetailsFirstCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
        
    }
    
    return self;
}

- (void)creatView {
    
 
    
    self.img = [[UIImageView alloc]init];
    self.img.image = [UIImage imageNamed:@"pdswcg"];
    [self.contentView addSubview:self.img];
    
    self.spellLabel = [[UILabel alloc]init];
    self.spellLabel.textColor = [UIColor whiteColor];
    self.spellLabel.font = FONT_FOURTEEN;
    self.spellLabel.text = @"拼单尚未成功   邀请小伙伴来助力吧！";
    [self.img addSubview:self.spellLabel];
    
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.textColor = COLOR_DIV;
    self.nameLabel.font = FONT_FOURTEEN;
    self.nameLabel.text = @"大杨    18722222131";
    [self.contentView addSubview:self.nameLabel];
    
    self.addView = [[UIView alloc]init];
    self.addView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.addView];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self.addView addGestureRecognizer:tap];
    
    
    self.addressBtn = [[UIButton alloc]init];
    [self.addressBtn setImage:[UIImage imageNamed:@"dzdw"] forState:UIControlStateNormal];
    [self.addView addSubview:self.addressBtn];
    
    self.addressLabel = [[UILabel alloc]init];
    self.addressLabel.textColor = COLOR_DIV;
    self.addressLabel.font = FONT_FOURTEEN;
    self.addressLabel.text = @"云南省昆明市盘龙区北京路";
    [self.addView addSubview:self.addressLabel];
    
    self.timeLabel = [[UILabel alloc]init];
    self.timeLabel.font = FONT_FOURTEEN;
    self.timeLabel.textColor = COLOR_ORG;
    self.timeLabel.text = @"待分享， 差6人，剩余时间12:44:12";
    [self.contentView addSubview:self.timeLabel];
    
    
    
}

- (void)setlayout {
    
    self.img.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.contentView, 0)
    .widthIs(SCREEN_WIDTH)
    .heightIs(120);
    
    self.spellLabel.sd_layout
    .leftSpaceToView(self.img, 20)
    .centerYEqualToView(self.img)
    .widthIs((SCREEN_WIDTH-20)/2)
    .autoHeightRatio(0)
    .maxHeightIs(40);
    
    
   self.nameLabel.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.img, 10)
    .widthIs(SCREEN_WIDTH -20)
    .heightIs(30);
    
    self.addView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.nameLabel, 10)
    .widthIs(SCREEN_WIDTH)
    .heightIs(30);
    
    self.addressBtn.sd_layout
    .leftSpaceToView(self.addView, 10)
    .topSpaceToView(self.addView, 0)
    .widthIs(15)
    .heightIs(15);
    
    self.addressLabel.sd_layout
    .leftSpaceToView(self.addressBtn, 10)
    .topSpaceToView(self.addView, 0)
    .widthIs(SCREEN_WIDTH-50)
    .heightIs(30);
    
    self.timeLabel.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.addView, 10)
    .widthIs(SCREEN_WIDTH - 20)
    .heightIs(30);
    
    
    [self setupAutoHeightWithBottomView:self.timeLabel bottomMargin:10];
    
    
}

- (void)tap:(UITapGestureRecognizer *)tap {
    
}

@end
